home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 31
/
Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso
/
Aminet
/
dev
/
gui
/
gui4cli.lha
/
Gui4Cli
/
Dir
/
dir.xpack
< prev
next >
Wrap
Text File
|
1999-04-21
|
6KB
|
206 lines
G4C
;
; April '97 by Brian Jones
; XPK packing and unpacking gui for D. Keletsekis' Dir.gc
;
; This gui needs xpack (from the XPK distribution in the c drawer)
; in C:
; Passwords are supported but not well trapped, if something won't
; unpack it probably needs a password (but it won't tell you).
; Also, not all xpk sub-libraries support password encoding so
; if you are trying to apply a password and it won't work the
; sub-library probably can't use one.
;
WINBIG -1 11 486 174 "Choose Packer -- Reload to get new files"
WinType 11110001
nofontsense
varpath dir.gc
xOnLoad
xid = $$lv.id
xdir = $$lv.dir
gosub dir.xpack startup1 ;load the listviews
gosub dir.xpack startup
run 'resident c:xpack pure add'
xOnReload
xid = $$lv.id
xdir = $$LV.DIR
gosub dir.xpack startup1
gosub dir.xpack startup
xOnClose
GuiQuit dir.xpack
xOnQuit ;cleanup
run 'resident xpack remove'
;The Listviews
;-------------------------------------------------------------
XLISTVIEW 174 19 160 129 "" rawcmprsr "LIBS:Compressors" 0 DIR ;see note
GadID 1 ;below
XLISTVIEW 5 16 150 146 "" cmprsr "" 0 TXT
GadID 2
update dir.xpack 4 $cmprsr
XLISTVIEW 161 32 320 131 "" xfile "" 10 MULTI
GadID 3
;The Gadgets
;------------------------------------------------------
TEXT 3 1 150 13 "RAKE" 100 BOX
GadID 4
XHSLIDER 54 159 64 12 "Mode?" xmode 0 100 100 "%ld%%"
GadID 5
XCYCLER 161 1 80 13 "" xchoice
GadID 6
CStr Pack pack
CStr Unpack unpack
gosub dir.xpack makegui
XBUTTON 404 1 77 13 "GO!"
GadID 7
lvuse dir.xpack 3
lvgo #0
xfile = $$lv.rec
xcount = 1
if $xchoice = pack
appvar cmprsr '.'
appvar cmprsr $xmode
endif
if $xpass = ""
psswrd = ""
else
psswrd = PASSWORD
endif
guiwindow dir.xpack wait
xpercent == $xcount * 100
xpercent == $xpercent / $xfilecount
update dir.xpack 10 $xpercent
Launch 1 'xpack $xfile $xmthd $cmprsr $psswrd $xpass ALL QUIET'
XBUTTON 324 1 77 13 "CANCEL"
GadID 8
guiClose dir.xpack
XBUTTON 244 1 77 13 "Reload"
GadID 9
xid = $$lv.id
xdir = $$LV.DIR
lvuse dir.xpack 3
lvclear
gosub dir.xpack startup
GAUGE 162 158 319 13 IN RIDGE 2 0 0
GadID 10
XTEXTIN 244 16 157 14 "Password " xpass "" 100
GadID 11
;-----------------------------------------------------------
xOnReturn 1 ;continuation of processing if there is more
lvuse dir.xpack 3 ;than one file.
counter xcount inc 1
if $xcount <= $$lv.total ; not the end of the lv
xpercent == $xcount * 100
xpercent == $xpercent / $xfilecount
update dir.xpack 10 $xpercent
lvgo next
xfile = $$lv.rec
Launch 1 'xpack $xfile $xmthd $cmprsr $psswrd $xpass ALL QUIET'
else
guiwindow dir.xpack resume
update dir.xpack 10 0
setwintitle dir.xpack 'Finished - Choose new files or quit'
lvuse dir.gc $xid
lvdir refresh
endif
;--------------------------------------------------------------
xroutine startup ;setup of the list of files to be packed
setscreen dir.xpack $*SCREEN ;or unpacked
xfilecount = 0
lvuse dir.gc $xid
lvmulti first
if $lv_file = ""
ezreq "How's about choosing\nsome files first ?" 'Oh yeah..' ""
stop
endif
while $lv_file > ""
extract lv_file ext tempinf
if $tempinf != ".info" ;;this is a filter for .info files so
counter xfilecount inc 1 ;they won't be packed and become
lvuse dir.xpack 3 ;unreadable
lvadd $lv_file
lvuse dir.gc $xid
endif
lvmulti next
endwhile
setgad dir.xpack 1 HIDE
guiopen dir.xpack
xRoutine startup1 ;set up of the list of xpk sub-libraries.
xchoice = pack ;this expects a normal xpk installation
xmthd = METHOD ;(Libs:Compressors) if not, change the
cmprsr = RAKE ;place that listview 1 looks for the
xmode = 100 ;sub-libraries (see listviews section
psswrd = "" ;above)
xpass = ""
lvuse dir.xpack 2
lvclear
LVuse dir.xpack 1
LVdir all
lvmulti first
while $rawcmprsr > ""
tempcmp = $$LV.REC
cutvar tempcmp CUT CHAR 3 dummy1
cutvar tempcmp CUT CHAR -8 dummy2
lvuse dir.xpack 2
lvadd $tempcmp
lvuse dir.xpack 1
lvmulti next
endwhile
xroutine makegui ;this could be easier if I put the
if $xchoice = pack ;xpk libraries list on the right
setgad dir.xpack 2 show ;instead of the left but I like
setgad dir.xpack 4 show ;it better that way
setgad dir.xpack 5 show
changearg dir.xpack 3 0 161
changearg dir.xpack 6 0 161
changearg dir.xpack 7 0 404
changearg dir.xpack 8 0 324
changearg dir.xpack 9 0 244
changearg dir.xpack 10 0 162
changearg dir.xpack 11 0 244
changegad dir.xpack 0 -1 11 486 174 ""
setwintitle dir.xpack "Choose Packer -- Reload to get new files"
xmthd = METHOD ;reset some stuff now that we're back in
xmode = 100 ;pack mode
update dir.xpack 5 100
if $cmprsr = ""
cmprsr = RAKE
endif
else
setgad dir.xpack 2 hide
setgad dir.xpack 4 hide
setgad dir.xpack 5 hide
changearg dir.xpack 3 0 2
changearg dir.xpack 6 0 2
changearg dir.xpack 7 0 245
changearg dir.xpack 8 0 165
changearg dir.xpack 9 0 85
changearg dir.xpack 10 0 4
changearg dir.xpack 11 0 85
changegad dir.xpack 0 -1 11 326 174 ""
setwintitle dir.xpack "Unpack -- Reload for new files"
xmthd = "" ;these are not needed in decompress mode
cmprsr = "" ;
endif
redraw dir.xpack